package cn.com.surker.material.service;

import cn.com.surker.material.entity.MainMaterial;
import cn.com.surker.oa.entity.OaMaterial;
import cn.com.surker.spring.RestResultDto;
import cn.com.surker.system.model.CacheUser;
import cn.com.surker.vo.main.MainMaterialVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 材料类型表
 */
public interface MainMaterialBaseService extends IService<MainMaterial> {

    /**
     *
     * @param searchVal
     * @param orgId
     * @param type
     * @param isDisplay
     * @param billWeightType
     * @param storeType
     * @param breedType
     * @param status
     * @param offset
     * @param limit
     * @return
     */
    IPage<MainMaterialVO> pageMaterial(String searchVal, Long orgId,Integer type,Integer isDisplay, Integer billWeightType, Integer storeType,Integer breedType, Integer status, Integer offset, Integer limit);

    /**
     * 更新数据
     * @param id
     * @param type
     * @param isDisplay
     * @param billWeightType
     * @param storeType
     * @param breedType
     * @param user
     * @return
     */
    RestResultDto update(Long id, Integer type, Integer isDisplay, Integer billWeightType, Integer storeType, Integer breedType, CacheUser user);

	/**
	 * 查询主材列表
	 *
	 * @param orgId      站点id
	 * @param supplierId 供应商id
	 * @return
	 */
	List<MainMaterial> findList(Long orgId, Long supplierId, String types);

	List<MainMaterial> findByOrg(Long orgId, Integer storageType, Long materialId);

	/**
	 * 新增材料
	 * @param materialId
	 * @param orgId
	 * @param isDisplay
	 * @param billWeightType 结算类型(0:按过磅重量结算，1：按供方重量计算)
	 * @param storeType 仓位类型(2:无0:筒仓1:堆场)
	 * @param breedType 材料重量 MaterialBreedTypeEnum
	 * @param creator
	 * @param parentId
	 * @return
	 */
	RestResultDto save(Long materialId, Long orgId,Integer isDisplay, Integer billWeightType,
					   Integer storeType,Integer breedType, Long parentId, String remark, String creator);

}
